home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 1049 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.3 KB

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: Nico Josuttis <nico@bredex.de>
  3. Newsgroups: comp.std.c++
  4. Subject: STL/String naming scheme confusion
  5. Date: 12 Apr 1996 14:57:23 GMT
  6. Organization: ?
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <199604120728.JAA01452@bredex.bredex.de>
  9. NNTP-Posting-Host: taumet.eng.sun.com
  10. Content-Length: 1520
  11. X-Lines: 42
  12. Originator: clamage@taumet
  13.  
  14.  
  15. Hi,
  16. Foregive me if I am wrong and sorry, if this sounds like a flame,
  17. but if I try to find a naming scheme for STL
  18. search/find algorithms, it all seems to be a confusion:
  19.  
  20. Consider:
  21.                          | basic_string       | STL algorithm
  22. -----------------------------------------------------------------
  23. find first elem          | find()             | find()
  24. find last elem           | rfind()            | - 
  25. find first subrange      | find()             | search()
  26. find last subrange       | rfind()            | find_end()
  27. find first elem of range | find_first_of()    | find_first_of()
  28. find last elem of range  | find_last_of()     | -
  29.  
  30. Why don't we use the string naming scheme ?
  31.  - Why is search() not also called find() ?
  32.  - Why is find_end() not called rfind() ?
  33.  
  34.   (I guess the missing algorithms do miss because
  35.    reverse iterators do the job)
  36.  
  37. OK, we had not many time but this is somehow typical
  38. for inconsistences in the library and happened of course due
  39. to historical reasons.
  40. For example to append elements, we have
  41.  +=, append, push_back
  42.  
  43. But it would be possible to get more conistence with only a bit of
  44. work. I think programmers will thank for it (oh certainly they won't,
  45. but they won't flame so much).
  46. And this is the last chance to make it more consistent.
  47.  
  48. Anything but historical reason against a change for that ?
  49. Am I missing something ?
  50.  
  51. If not, I could try to make a full table for all such naming
  52. inconsistences to have a base to discuss a consistent solution.
  53.  
  54. Nico
  55. nico@bredex.de
  56.  
  57.  
  58. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  59. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  60. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  61. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  62. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  63.